import { http } from "@/utils/http";

/** 获取公告信息 */

export type NoticeInfo = {
  id: number;
  title: string;
  type: string;
  content: string;
  updateTime: string;
  status: number;
  imgs: Array<string>;
};

export type GetNoticeResult = {
  list: Array<NoticeInfo>;
  total: number;
};

export const getNotice = (params?: object) => {
  return http.request<GetNoticeResult>("get", "/api/manager/view/notify", {
    params
  });
};

/** 添加公告信息 */

export const addNotice = (data?: object) => {
  return http.request<object>("post", "/api/tmxk/jhx/moudles/addNotify", {
    data
  });
};
